package com.example;

import com.example.test.MessageGateway;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.integration.config.EnableIntegration;

@SpringBootApplication
@EnableIntegration
@Slf4j
public class MqttApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext ctx = SpringApplication.run(MqttApplication.class, args);

        MessageGateway gateway = ctx.getBean(MessageGateway.class);
        String s = gateway.send("Hello, Spring Integration!");
        log.info(s);
    }

}
